<template>
  <Row>
    <Col span="12">
      <Form :label-width="100" ref="redislData" :model="redislData">
        <FormItem label="Key" prop="Key">
          <Input placeholder="Key" v-model="redislData.Key" readonly/>
        </FormItem>
        <FormItem label="Value" prop="Value">
          <Input placeholder="Value" v-model="redislData.Value" type="textarea" :rows="10" readonly/>
        </FormItem>
        <FormItem>
          <Button style="width:100px;margin-left: 220px" type="primary" @click="closeCurrentModal();"
                  :loading="isBtnLoading">关闭
          </Button>
        </FormItem>
      </Form>
    </Col>
  </Row>
</template>

<script>
import { getRedisCommonConfig } from '@/api/system'

export default {
  name: 'redisManager',
  data () {
    return {
      isBtnLoading: false,
      redislData: {
        'Key': '',
        'Value': ''
      }
    }
  },
  methods: {
    getRedisData (row) {
      this.$refs['redislData'].resetFields()
      const me = this
      const sendCatParam = {}
      sendCatParam.config_key = row.config_key
      sendCatParam.config_type = row.config_type
      getRedisCommonConfig(sendCatParam).then(res => {
        if (res.code === 200) {
          me.redislData.Key = res.data.key
          me.redislData.Value = res.data.value
          me.model = true
        } else {
          me.$Message.success(res.msg)
        }
      })
    },
    closeCurrentModal () {
      this.model = false
    }
  },
}
</script>

<style scoped>

</style>
